home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / sframework / plugins / PowerDVD5.vbs < prev    next >
Encoding:
Text File  |  2004-09-09  |  4.3 KB  |  179 lines

  1. 'FMA Script Framework Plugin
  2. 'PowerDVD5
  3. 'Lets you control PowerDVD5
  4.  
  5. 'TODO:
  6. '-Testing
  7.  
  8. Class PowerDVD5
  9.     
  10.     Private llist
  11.     Private m_Self
  12.     Private mainMenu
  13.     
  14.     'Some info about the plugin
  15.     Public Property Get SHOWABLE 'Do I have a menu?
  16.         SHOWABLE    = True
  17.     End Property
  18.     Public Property Get TITLE 'What's my name?
  19.         TITLE       = "PowerDVD 5"
  20.     End Property
  21.     Public Property Get DESCRIPTION 'What's my purpose?
  22.         DESCRIPTION = "Lets you control PowerDVD5"
  23.     End Property
  24.     Public Property Get AUTHOR 'Who created me?
  25.         AUTHOR      = "streawkceur (inspired by CarpeDi3m)"
  26.     End Property
  27.     Public Property Get URL 'Were can I be found? Where can you get more information?
  28.         URL = "http://fma.xinium.com/"
  29.     End Property
  30.     
  31.     'Who am I?
  32.     Public Property Let Self (s)
  33.         m_Self = s
  34.         ' Some init stuff here:
  35.         If IsEmpty(Settings(Me, "Title")) or Settings(Me, "Title") = "" Then Settings(Me, "Title") = "PowerDVD"
  36.         If IsEmpty(Settings(Me, "Exe"))   or Settings(Me, "Exe")   = "" Then Settings(Me, "Exe")   = "C:\Program Files\Cyberlink\PowerDVD\PowerDVD.exe"
  37.         Set mainMenu = New ManagedMenu
  38.         mainMenu.Title = TITLE
  39.     End Property
  40.     Public Property Get Self
  41.         Self = m_Self
  42.     End Property
  43.     
  44.     'Display me. Eventually put a menu on the screen
  45.     Sub Show()
  46.         '--> Init Menu
  47.         Set llist = New LinkedList
  48.         Dim bi
  49.         bi = llist.BackInserter
  50.         If PowerDVDOpen Then
  51.             bi.Item = Array("Play",          Self & ".Play")
  52.             bi.Item = Array("Pause",         Self & ".Pause")
  53.             bi.Item = Array("Stop",          Self & ".Stopp")
  54.             bi.Item = Array("Prev Chapter",  Self & ".PrevChapter")
  55.             bi.Item = Array("Next Chapter",  Self & ".NextChapter")
  56.             bi.Item = Array("AudioStream",   Self & ".AudioStream")
  57.             bi.Item = Array("Subtitles",     Self & ".SubTitles")
  58.             bi.Item = Array("Fullscreen",    Self & ".Fullscreen")
  59.             bi.Item = Array("Volume +5",     Self & ".VolumeUp")
  60.             bi.Item = Array("Volume -5",     Self & ".VolumeDown")
  61.             bi.Item = Array("(Un)Mute",      Self & ".Mute")
  62.             bi.Item = Array("Step Backward", Self & ".StepBwd")
  63.             bi.Item = Array("Step Forward",  Self & ".StepFwd")
  64.             bi.Item = Array("Set Repeat",    Self & ".Repeat")
  65.             bi.Item = Array("Capture Frame", Self & ".CaptureFrame")
  66.             bi.Item = Array("Minimize",      Self & ".Minimize")
  67.             bi.Item = Array("Close",         Self & ".Close")
  68.         Else
  69.             bi.Item = Array("Launch",        Self & ".Launch")
  70.         End If
  71.         mainMenu.SetList llist
  72.         mainMenu.ShowMenu
  73.     End Sub
  74.     
  75.     Function PowerDVDOpen
  76.         PowerDVDOpen = Shell.AppActivate(Settings(Me, "Title"))
  77.     End Function
  78.     
  79.     Sub Launch
  80.         If Fso.FileExists(Settings(Me, "Exe")) Then
  81.             Shell.Exec Settings(Me, "Exe")
  82.             Util.WaitForAppLoad Settings(Me, "Title"), 10000 'Give PDVD max. 10 secs to load
  83.         Else
  84.             Debug.ErrorMsg Self & " - Launch: File not found: " & Settings(Me, "Exe")
  85.         End If
  86.         Show
  87.     End Sub
  88.     
  89.     Sub Close
  90.         If PowerDVDOpen Then
  91.             Shell.SendKeys "^x"
  92.             Util.Sleep 3000 'Give PDVD 3secs to close itself
  93.         End If
  94.         Show
  95.     End Sub
  96.     
  97.     Sub Play
  98.         If PowerDVDOpen Then Shell.SendKeys "~"
  99.         am.Update
  100.     End Sub
  101.     
  102.     Sub Pause
  103.         If PowerDVDOpen Then Shell.SendKeys "{ }"
  104.         am.Update
  105.     End Sub
  106.     
  107.     Sub Stopp
  108.         If PowerDVDOpen Then Shell.SendKeys "s"
  109.         am.Update
  110.     End Sub
  111.     
  112.     Sub PrevChapter
  113.         If PowerDVDOpen Then Shell.SendKeys "p"
  114.         am.Update
  115.     End Sub
  116.     
  117.     Sub NextChapter
  118.         If PowerDVDOpen Then Shell.SendKeys "n"
  119.         am.Update
  120.     End Sub
  121.     
  122.     Sub SubTitles
  123.         If PowerDVDOpen Then Shell.SendKeys "u"
  124.         am.Update
  125.     End Sub
  126.     
  127.     Sub Repeat
  128.         If PowerDVDOpen Then Shell.SendKeys "r"
  129.         am.Update
  130.     End Sub
  131.     
  132.     Sub StepBwd
  133.         If PowerDVDOpen Then Shell.SendKeys "^b"
  134.         am.Update
  135.     End Sub
  136.     
  137.     Sub StepFwd
  138.         If PowerDVDOpen Then Shell.SendKeys "t"
  139.         am.Update
  140.     End Sub
  141.     
  142.     Sub CaptureFrame
  143.         If PowerDVDOpen Then Shell.SendKeys "c"
  144.         am.Update
  145.     End Sub
  146.     
  147.     Sub AudioStream
  148.         If PowerDVDOpen Then Shell.SendKeys "h"
  149.         am.Update
  150.     End Sub
  151.     
  152.     Sub VolumeUp
  153.         If PowerDVDOpen Then Shell.SendKeys "{+}"
  154.         am.Update
  155.     End Sub
  156.     
  157.     Sub VolumeDown
  158.         If PowerDVDOpen Then Shell.SendKeys "{-}"
  159.         am.Update
  160.     End Sub
  161.     
  162.     Sub Mute
  163.         If PowerDVDOpen Then Shell.SendKeys "q"
  164.         am.Update
  165.     End Sub
  166.     
  167.     Sub Fullscreen
  168.         If PowerDVDOpen Then Shell.SendKeys "z"
  169.         am.Update
  170.     End Sub
  171.     
  172.     Sub Minimize
  173.         If PowerDVDOpen Then Shell.SendKeys "^n"
  174.         am.Update
  175.     End Sub    
  176.     
  177. End Class
  178.  
  179.